home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-07-03 | 4.4 KB | 159 lines | [TEXT/MPS ] |
- #
- # File: Install, MPW Shell script
- # Author: Malcolm H. Teas Apple Computer, Inc. SCM
- # Creation Date: 11/28/88
- #
- # Modified by Kerry Laidlaw 2/7/90
- # Changed names to avoid confusion with prior tool.
- #
- # Function:
- # Install or uninstall the Localization Verifier into a user's system.
- #
- # In-Outputs:
- # None.
- #
- # Notes:
- # In the 1.0b2 release, the removal feature in the UserStartup script
- # deliberatly uses the wrong spelling for Auditor "-er". It also duplicates
- # this with the correct spelling. This is so it can remove the old Auditer.
- # This will have to be changed in the future.
- #
-
- # Save the value of some MPW globals, restore at the end.
- set save-exit {exit}
- set exit 0
- set save-echo {echo}
- set echo 0 # Set this to 1 for debugging.
-
- # Find out if we're installing or removing.
- if "`exists -f "{MPW}Scripts:verify-menu"`"
- # We should be removing. Ask about un-installation.
- Confirm "Do you want to remove the Localization Verifier?"
- if {status} != 0 # The cancel button
- set exit {save-exit}
- set echo {save-echo}
- exit 2
- end
-
- # Destroy the files.
- delete -p "{MPW}Scripts:verify-menu"
- delete -p "{MPW}Scripts:check-disk"
- delete -p "{MPW}Scripts:compare-disks"
- delete -p "{MPW}Scripts:makelist"
- delete -p "{MPW}Interfaces:RIncludes:newtypes.r"
- delete -p "{MPW}Tools:resDiff"
- delete -p "{MPW}Tools:create.rnamefile" # *kl*
-
-
- # Remove the menu.
- deletemenu "verify"
- echo "Removing the Localization Verifier menu command from your UserStartup file..."
- open "{ShellDirectory}UserStartup"
- find • "{ShellDirectory}UserStartup"
- loop
- clear "/•∂n#∂tMake the menu for the Localization Verifier.∞/" "{ShellDirectory}UserStartup"
- if {status} != 0
- break
- end
- clear "/•∂nverify-menu∞/" "{ShellDirectory}UserStartup"
- if {status} != 0
- break
- end
- end
- loop
- clear "/•∂n#∂tMake the menu for the Localization Verifier.∞/" "{ShellDirectory}UserStartup"
- if {status} != 0
- break
- end
- clear "/•∂nverify-menu∞/" "{ShellDirectory}UserStartup"
- if {status} != 0
- break
- end
- end
- close -y "{ShellDirectory}UserStartup"
-
- # Restore the state of the world and exit.
- echo "∂n∂tDone!∂n"
- set exit {save-exit}
- set echo {save-echo}
- exit 0
- end
-
- # Ask about installation.
- Confirm "Do you want to install the Localization Verifier?"
- if {status} != 0 # The cancel button
- set exit {save-exit}
- set echo {save-echo}
- exit 2
- end
- # Check the files.
- if !"`exists -f "verify-menu"`"
- alert "Missing the file verify-menu,∂nrestart from the correct directory."
- set exit {save-exit}
- set echo {save-echo}
- exit 2
- end
- if !"`exists -f "check-disk"`"
- alert "Missing the file check-disk,∂nrestart from the correct directory."
- set exit {save-exit}
- set echo {save-echo}
- exit 2
- end
- if !"`exists -f "compare-disks"`"
- alert "Missing the file compare-disks,∂nrestart from the correct directory."
- set exit {save-exit}
- set echo {save-echo}
- exit 2
- end
- if !"`exists -f "makelist"`"
- alert "Missing the file makelist,∂nrestart from the correct directory."
- set exit {save-exit}
- set echo {save-echo}
- exit 2
- end
- if !"`exists -f "newtypes.r"`"
- alert "Missing the file newtypes.r,∂nrestart from the correct directory."
- set exit {save-exit}
- set echo {save-echo}
- exit 2
- end
- if !"`exists -f "resDiff"`"
- alerts "Missing the file resDiff,∂nrestart from the correct directory."
- set exit {save-exit}
- set echo {save-echo}
- exit 2
- end
- if !"`exists -f "create.rnamefile"`"
- alerts "Missing the file create.rnamefile,∂nrestart from the correct directory."
- set exit {save-exit}
- set echo {save-echo}
- exit 2
- end
- if !"`exists -f "catinfo"`"
- alert "Missing the file catinfo,∂nrestart from the correct directory."
- set exit {save-exit}
- set echo {save-echo}
- exit 2
- end
-
- # Get the files from the floppy and put them into their new homes.
- duplicate -c -p "verify-menu" "{MPW}Scripts:"
- duplicate -c -p "check-disk" "{MPW}Scripts:"
- duplicate -c -p "compare-disks" "{MPW}Scripts:"
- duplicate -c -p "makelist" "{MPW}Scripts:"
- duplicate -c -p "newtypes.r" "{MPW}Interfaces:RIncludes:"
- duplicate -c -p "resDiff" "{MPW}Tools:"
- duplicate -c -p "create.rnamefile" "{MPW}Tools:"
- duplicate -c -p "catinfo" "{MPW}Tools:"
-
- # Add the new menu.
- echo "Adding the menu command to your UserStartup file..."
- echo "#∂tMake the menu for the Localization Verifier." >> "{ShellDirectory}UserStartup"
- echo "verify-menu" >> "{ShellDirectory}UserStartup"
- verify-menu # Make the menu right now too.
-
- # Restore the state of the world and exit.
- echo "∂n∂tDone!∂n"
- set exit {save-exit}
- set echo {save-echo}
- exit 0